#!/bin/bash

#project list: a33 a23an44 a23 a23 a3x

function do_create_repo()
{
    mkdir lichee
    cd lichee
    repo init -u ssh://git@192.168.1.33/git_repo/$1/manifest.git -m lichee.xml
    repo sync
    cd ../

    mkdir android
    cd android
    repo init -u ssh://git@192.168.1.33/git_repo/$1/manifest.git -m android.xml
    repo sync
    cd ../
}

function do_create_git()
{
    git clone git@192.168.1.137:$1/android.git
    git clone git@192.168.1.137:$1/lichee.git
}

function create_repo_dir()
{
	mkdir $1 
	cd $1
	do_create_repo $1
	cd ..
}

function create_git_dir()
{
	mkdir $1 
	cd $1
	do_create_git $1
	cd ..
}

if [ "$1" = "a10" ] || [ "$1" = "a13" ] || [ "$1" = "a31s" ]; then
    create_git_dir $1
else 
    create_repo_dir $1
fi
